class Ability
  include CanCan::Ability

  def initialize(user)
    # Define abilities for the passed in user here. For example:
    #
    user ||= User.new(role: :general)# guest user (not logged in)
    if user.admin?
      puts "admin"
      can :access, :rails_admin   # only allow admin users to access Rails Admin
      can :read, :dashboard       # allow access to dashboard
      can :manage, :all
    end
  end

end